import java.util.*;



public class Test {

    public static void fun2(String s1,String s2){
        Deque<Integer> stack1=new LinkedList<>();
        Deque<Integer> stack2=new LinkedList<>();
        Deque <Integer> stack3=new LinkedList<>();
        for (int i = 0; i < s1.length(); i++) {
            int ch=s1.charAt(i)-'0';
            stack2.push(ch);
        }
        for (int i = 0; i < s2.length(); i++) {
            int ch=s2.charAt(i)-'0';
            stack3.push(ch);
        }
        while(!stack2.isEmpty()&&!stack3.isEmpty()){
            if(stack2.peek()<stack3.peek()){
                stack1.push(stack2.pop()+10-stack3.pop());

            }
        }
    }

    public static void fun1(String s1,String s2){
        Deque<Integer> stack1=new LinkedList<>();
        Deque<Integer> stack2=new LinkedList<>();
        Deque <Integer> stack3=new LinkedList<>();
        for (int i = 0; i < s1.length(); i++) {
            int ch=s1.charAt(i)-'0';
            stack2.push(ch);
        }
        for (int i = 0; i < s2.length(); i++) {
            int ch=s2.charAt(i)-'0';
            stack3.push(ch);
        }
        int k=0;
        while(!stack2.isEmpty()&&!stack3.isEmpty()){
            int tmp=stack2.poll()+stack3.poll()+k;
            if(tmp>=10){
                k=1;
                int ca=tmp%10;
                stack1.push(ca);
            }
            else{
                k=0;
                int ca=tmp%10;
                stack1.push(ca);
            }
        }

        if(!stack2.isEmpty()&&stack3.isEmpty()){
            while(!stack2.isEmpty()) {
                int tmp = stack2.poll() + k;
                if(tmp>=10){
                    k=1;
                    int ch=tmp%10;
                    stack1.push(ch);
                }else {
                    k = 0;
                    int ca = tmp % 10;
                    stack1.push(ca);
                }

            }
            if(k==1){  //前几个高位是99...
                stack1.push(1);
                k=0;
            }

        }else if(stack2.isEmpty()&&!stack3.isEmpty()){
            while(!stack3.isEmpty()) {
                int tmp = stack3.poll() + k;
                if(tmp>=10){
                    k=1;
                    int ch=tmp%10;
                    stack1.push(ch);
                }else {
                    k = 0;
                    int ca = tmp % 10;
                    stack1.push(ca);
                }

            }
            if(k==1){  //前几个高位是99...
                stack1.push(1);
            }
        }else{
            if(k==1){
                stack1.push(1);
            }
        }
        while(!stack1.isEmpty()){
            System.out.print(stack1.pop());
        }

    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s1=sc.nextLine();
        String s2=sc.nextLine();
        if(s1.charAt(0)!='-'&&s2.charAt(0)!='-'){
            fun1(s1,s2);
        }else if(s1.charAt(0)=='-'&&s2.charAt(0)=='-'){
            String newS1=s1.replaceAll("-","");
            String newS2=s2.replaceAll("-","");
            System.out.print("-");
            fun1(newS1,newS2);
        }else{
            if(s1.charAt(0)=='-'&&s2.charAt(0)!='-'){
                String newS1=s1.replaceAll("-","");
                if(newS1.compareTo(s2)>0){

                }
            }
        }
    }
    public static void main1(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s1=sc.nextLine();
        String s2=sc.nextLine();
        Deque<Integer> stack1=new LinkedList<>();
        Deque<Integer> stack2=new LinkedList<>();
        Deque <Integer> stack3=new LinkedList<>();
        for (int i = 0; i < s1.length(); i++) {
            int ch=s1.charAt(i)-'0';
            stack2.push(ch);
        }
        for (int i = 0; i < s2.length(); i++) {
            int ch=s2.charAt(i)-'0';
            stack3.push(ch);
        }
        int k=0;
        while(!stack2.isEmpty()&&!stack3.isEmpty()){
            int tmp=stack2.poll()+stack3.poll()+k;
            if(tmp>=10){
                k=1;
                int ca=tmp%10;
                stack1.push(ca);
            }
            else{
                k=0;
                int ca=tmp%10;
                stack1.push(ca);
            }
        }

        if(!stack2.isEmpty()&&stack3.isEmpty()){
            while(!stack2.isEmpty()) {
                int tmp = stack2.poll() + k;
                if(tmp>=10){
                    k=1;
                    int ch=tmp%10;
                    stack1.push(ch);
                }else {
                    k = 0;
                    int ca = tmp % 10;
                    stack1.push(ca);
                }

            }
            if(k==1){  //前几个高位是99...
                stack1.push(1);
                k=0;
            }

        }else if(stack2.isEmpty()&&!stack3.isEmpty()){
            while(!stack3.isEmpty()) {
                int tmp = stack3.poll() + k;
                if(tmp>=10){
                    k=1;
                    int ch=tmp%10;
                    stack1.push(ch);
                }else {
                    k = 0;
                    int ca = tmp % 10;
                    stack1.push(ca);
                }

            }
            if(k==1){  //前几个高位是99...
                stack1.push(1);
            }
        }else{
            if(k==1){
                stack1.push(1);
            }
        }
        while(!stack1.isEmpty()){
            System.out.print(stack1.poll());
        }
    }

}

